#include <stdio.h>
int main()
{
    char c = 0;
    char word[100][22] = { '\0' };
    int wordSize = 0;
    int wordlength = 0;
    while ((c = getchar()) != EOF)
    {
        if (c == '\n')
        {
            break;
        }
        if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
        {
            word[wordSize][wordlength++] = c;
        }
        else
        {
            wordSize++;
            wordlength = 0;
        }   
    }
    int i = 0;
    for (i = wordSize - 1; i >= 0; i--)
    {
        printf("%s ", word[i]);
    }
    return 0;
}